package com.huaxin.hxmodulestatisticalanalysis.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 温湿度数据实体（用于双Y轴折线图）
 */
public class TemperatureHumidityData {
    /**
     * 温湿度数据实体（用于双Y轴折线图）
     */
    @Schema(description = "温度数据")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime time;           // 时间点
    /**
     * 温度 (℃)
     */
    @Schema(description = "温度数据")
    private BigDecimal temperature;       // 温度 (℃)
    /**
     * 湿度 (%RH)
     */
    @Schema(description = "湿度数据")
    private BigDecimal humidity;          // 湿度 (%RH)

    // 构造函数
    public TemperatureHumidityData() {
    }

    public TemperatureHumidityData(LocalDateTime time, BigDecimal temperature, BigDecimal humidity) {
        this.time = time;
        this.temperature = temperature;
        this.humidity = humidity;
    }

    // Getters and Setters
    public LocalDateTime getTime() {
        return time;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }

    public BigDecimal getTemperature() {
        return temperature;
    }

    public void setTemperature(BigDecimal temperature) {
        this.temperature = temperature;
    }

    public BigDecimal getHumidity() {
        return humidity;
    }

    public void setHumidity(BigDecimal humidity) {
        this.humidity = humidity;
    }

    @Override
    public String toString() {
        return "TemperatureHumidityData{" +
                "time=" + time +
                ", temperature=" + temperature +
                ", humidity=" + humidity +
                '}';
    }
}